/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package paises;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;

/**
 *
 * @author sergio.mona
 */
public class NewMain {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Configuration configuration = new Configuration();
        SessionFactory  sessionFactory = configuration.configure().buildSessionFactory();
        Session session = sessionFactory.openSession();
        Transaction transaction = session.beginTransaction();
        Query query = session.createQuery("delete from Book where id=5");
        query.executeUpdate();
        transaction.commit();
    }
    
}
